//
//  LagouImageView.m
//  作业2
//
//  Created by dllo on 16/7/16.
//  Copyright © 2016年 YMJ. All rights reserved.
//

#import "LagouImageView.h"

@implementation LagouImageView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
+ (LagouImageView *)createImageView {
    LagouImageView *backgroundImageView = [[LagouImageView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    [backgroundImageView setImage:[UIImage imageNamed:@"welcome_2.jpg"]];
    UIImageView *lagouLogo = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 120  , 180)];
    lagouLogo.center = CGPointMake(WIDTH / 2, 150);
    [lagouLogo setImage:[UIImage imageNamed:@"logo_lagou@3x.png"]];
    [backgroundImageView addSubview:lagouLogo];
    // 随便逛逛
    backgroundImageView.lookAroundButton = [UIButton buttonWithType:UIButtonTypeCustom];
    backgroundImageView.lookAroundButton.frame = CGRectMake(WIDTH - 120, 0, 120, 50);
    [backgroundImageView addSubview:backgroundImageView.lookAroundButton];
    backgroundImageView.lookAroundButton.backgroundColor = [UIColor clearColor];
    backgroundImageView.lookAroundButton.alpha = 0.5;
    [backgroundImageView.lookAroundButton setTitle:@"随便逛逛>" forState:0];
    [backgroundImageView.lookAroundButton setTitleColor:[UIColor whiteColor] forState:0];
    backgroundImageView.lookAroundButton.titleLabel.font = [UIFont boldSystemFontOfSize:18];
    // 打开用户交互
    [backgroundImageView setUserInteractionEnabled:YES];
    return backgroundImageView;
}
@end
